<?php
require_once("../inc/conn.php");
require_once("../inc/session.php");
//接收传递来的值
$name=$_POST["name"];
//比较密码

	//定义SQL语句  实现写入
$sql="insert into department(name) values('".$name."')";
//执行sql语句
$rs=$conn->query($sql);
if($rs){
	echo "<script>alert('写入成功！');location.href='departlist.php';</script>";
}else{
	echo "<script>alert('写入失败！');location.href='departadmin.php';</script>";

}

?>